<template>
  <view class="container">
    <uni-list>
      <uni-list-item showExtraIcon="true" title="姓名" :rightText="driver.driverName" />
      <uni-list-item showExtraIcon="true" title="联系方式" :rightText="driver.driverPhone" />
      <uni-list-item showExtraIcon="true" title="年龄" :rightText="driver.driverAge.toString()" />
      <uni-list-item showExtraIcon="true" title="驾龄" :rightText="driver.driverYears.toString()" />
	  <uni-list-item showExtraIcon="true" title="身份背景" :rightText="driver.driverBackground" />
	  <uni-list-item showExtraIcon="true" title="身份证" />
	   <image :src="driver.driverLicence" style="width: 60%; height: 160px; margin: auto;"></image>
    </uni-list>
  </view>
</template>

<script>
  import { getDriverInfo } from "@/api/system/user"
  var driverId = localStorage.getItem("driverId");

  export default {
    data() {
      return {
        driver: {
		    driverName:'',
			driverPhone:'',
			driverAge:'',
			driverYears:'',
			driverLicence:'',
			driverBackground:''
		}
      }
    },
    onLoad() {
      this.getDriver();
    },
    methods: {
      getDriver() {
        getDriverInfo(driverId).then(response => {
          this.driver = response.data
		  console.log(this.driver.driverLicence)
        })
      }
    }
  }
</script>

<style lang="scss">
  page {
    background-color: #ffffff;
  }
</style>
